package com.tr1701_demo.moder.dao;

import java.util.List;

import com.tr1701_demo.moder.entitys.AccountGoodsVo;
import com.tr1701_demo.moder.entitys.xiangdan;
import com.tr1701_demo.utils.BaseDao;

public class AccountDao {
		BaseDao<AccountGoodsVo> dao=new BaseDao<>(AccountGoodsVo.class);
		
		public List<AccountGoodsVo> getAccounts(String gid){
			String sql="SELECT * FROM goodss a INNER JOIN cart b ON a.gspbh1=b.gspbh INNER JOIN datum c "+
					"on b.oyhbh=c.oyhbh  WHERE a.gspbh1 in ("+gid+") AND con=1";
			return dao.selectAll(sql, null);
			
		}
		public int addXiang(xiangdan xd){
			String sql="insert into detailed values(null,?,?,?)";
			return dao.executeUpdate(sql, new Object[]{xd.getDid(),xd.getDoid(),xd.getGspbh(),xd.getDdnum()});
		}
}
